home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0399 / 93 / mlib28d.zoo / diffc next >
Encoding:
Text File  |  1993-02-19  |  29.4 KB  |  1,099 lines

  1. diff -c ../mntlib27/a64l.c ./a64l.c
  2. *** ../mntlib27/a64l.c    Thu Jan 14 10:37:02 1993
  3. --- ./a64l.c    Sat Feb 13 03:45:54 1993
  4. ***************
  5. *** 14,19 ****
  6. --- 14,20 ----
  7.       a64l, l64a - convert between long integer and base-64 ASCII string
  8.   
  9.   SYNOPSIS
  10. +     #include <support.h>
  11.       long a64l(const char *s);
  12.       char *l64a(long l);
  13.   
  14. diff -c ../mntlib27/access.c ./access.c
  15. *** ../mntlib27/access.c    Sat Sep  5 07:03:50 1992
  16. --- ./access.c    Sat Feb 13 10:17:54 1993
  17. ***************
  18. *** 20,29 ****
  19.       if (mode == F_OK)
  20.           return 0;    /* existence test succeeded */
  21.   
  22.   /* somewhat crufty code -- relies on R_OK, etc. matching the bits in the
  23.      file mode, but what the heck, we can do this
  24.    */
  25. !     if (__mint < 9 || ( geteuid() == sb.st_uid ) ) {
  26.           if ( ((sb.st_mode >> 6) & mode) == mode )
  27.               return 0;
  28.           else
  29. --- 20,31 ----
  30.       if (mode == F_OK)
  31.           return 0;    /* existence test succeeded */
  32.   
  33. +     if (getuid() == 0) return 0; /* super user can access anything */
  34.   /* somewhat crufty code -- relies on R_OK, etc. matching the bits in the
  35.      file mode, but what the heck, we can do this
  36.    */
  37. !     if (__mint < 9 || ( getuid() == sb.st_uid ) ) {
  38.           if ( ((sb.st_mode >> 6) & mode) == mode )
  39.               return 0;
  40.           else
  41. ***************
  42. *** 30,36 ****
  43.               goto accdn;
  44.       }
  45.   
  46. !     if ( getegid() == sb.st_gid ) {
  47.           if ( ((sb.st_mode >> 3) & mode) == mode )
  48.               return 0;
  49.           else
  50. --- 32,38 ----
  51.               goto accdn;
  52.       }
  53.   
  54. !     if ( getgid() == sb.st_gid ) {
  55.           if ( ((sb.st_mode >> 3) & mode) == mode )
  56.               return 0;
  57.           else
  58. diff -c ../mntlib27/alarm.c ./alarm.c
  59. *** ../mntlib27/alarm.c    Sat Sep  5 07:11:32 1992
  60. --- ./alarm.c    Fri Feb 19 09:25:30 1993
  61. ***************
  62. *** 4,9 ****
  63. --- 4,10 ----
  64.   
  65.   #include <errno.h>
  66.   #include <mintbind.h>
  67. + #include <limits.h>
  68.   
  69.   extern int __mint;
  70.   
  71. ***************
  72. *** 14,26 ****
  73.       long r;
  74.   
  75.       if (__mint == 0)
  76. !         r = -EINVAL;
  77. !     else
  78. !         r = Talarm((long)secs);
  79.   
  80. -     if (r < 0) {
  81. -         errno = - (int)r;
  82. -         r = -1;
  83. -     }
  84.       return (unsigned int) r;
  85.   }
  86. --- 15,26 ----
  87.       long r;
  88.   
  89.       if (__mint == 0)
  90. !         return 0;
  91. ! #ifndef __MSHORT__
  92. !     if (secs > ((unsigned int) (LONG_MAX/1000)))
  93. !         secs = ((unsigned int) (LONG_MAX/1000));
  94. ! #endif
  95. !     r = Talarm((long) secs);
  96.   
  97.       return (unsigned int) r;
  98.   }
  99. diff -c ../mntlib27/bugs ./bugs
  100. *** ../mntlib27/bugs    Wed Feb 10 07:11:42 1993
  101. --- ./bugs    Fri Feb 19 09:18:44 1993
  102. ***************
  103. *** 18,74 ****
  104.     up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
  105.     Some obvious candidates are killpg.c and unx2dos.c.
  106.   
  107. ! a64l.c: ++boender
  108. !   Include `#include <support.h>' in the man page, just above the 
  109. !   prototype. I know few people will notice, but I try to keep
  110. !   things in sync with my Pure-C helpfile.
  111. ! access.c: ++boender
  112. !   My System V.3 manpages state `access checks for accessibility, using
  113. !   the real user ID in place of the effective user ID and the real group
  114. !   ID in place of the effective group ID.'.
  115. !   The access() in the mintlibs uses the effective user ID and the
  116. !   effective group ID. Could you check your UN*X manpages to see
  117. !   whether this is a BSD vs. AT&T difference or if the mintlibs
  118. !   got it wrong? Fixing this would of course be trivial.
  119. ! alarm.c: ++boender
  120. !   This call will fail when used in 32-bit mode (gcc -mlong) with a
  121. !   value >= 2^31, since this will result in an `enquire' call to
  122. !   Talarm(). I think these calls should be filtered out. Just
  123. !   checking "if ((long)secs < 0) {return _EINVAL;}" should do the trick.
  124. !   Dynix manual pages also state that "the largest allowed value is
  125. !   2^31".
  126.   
  127.   bsearch.c: ++entropy
  128.     Someone on the net said the args were wrong; it looks right to me.
  129.     What's the problem?
  130.   
  131. ! clock.c: ++boender
  132. !   This function is hopelessly different from the UNIX version, since
  133. !   it returns time elapsed since the program started, and not the CPU
  134. !   time used by the process and its children that have terminated so
  135. !   far.  Also, the time units used are different.  This may be hard to
  136. !   fix...
  137. ! getcwd.c: ++boender
  138. !   This function would be easier to implement using the Dgetcwd() call
  139. !   available since MiNT 0.96. Since that function does better checking
  140. !   anyway (it will not overflow the buffer if the path doesn't fit),
  141. !   testing "if (__mint <= 95) {old-code} else {Dgetcwd()}" would be
  142. !   a Good Thing.
  143.   
  144.   getopt.c, unistd.h: ++boender
  145.     The three externally usable variables defined in getopt.c should be
  146.     included in <unistd.h>, where getopt() is declared too.  These
  147.     are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
  148.   
  149. -   Not really a bug.  Leave it this way because UNIX doesn't have these
  150. -   vars in any headers either.
  151. - getpass.c: ++entropy
  152. -   getpass() reads from stdin, should read /dev/tty like UNIX.
  153.   getuid.c: ++boender, ++entropy
  154.     Under UNIX Sys VR3 (didn't check SunOS), setpgrp() takes no parameters
  155.     and sets the process group ID of the calling process to its own process
  156. --- 18,55 ----
  157.     up at some time, i.e. do we stop supporting MiNT before 0.8 or 0.9?
  158.     Some obvious candidates are killpg.c and unx2dos.c.
  159.   
  160. ! alarm.c: ++entropy
  161. !   alarm() will silently "round down" any requested time greater than 2
  162. !   million "or so" seconds.  Most UNIXes allow much larger maximum values
  163. !   (usually LONG_MAX).  MiNT needs this extremely small maximum value because
  164. !   wakeup scheduling is calculated in milliseconds by the kernel.  This
  165. !   cannot be fixed without changing MiNT.  alarm() does not work at all under
  166. !   TOS.
  167.   
  168.   bsearch.c: ++entropy
  169.     Someone on the net said the args were wrong; it looks right to me.
  170.     What's the problem?
  171.   
  172. ! clock.c: ++boender, ++entropy
  173. !   clock() is currently implemented as an alias for _clock(), which makes it
  174. !   hopelessly different from the UNIX version, since it returns time elapsed
  175. !   since the program started, and not the CPU time used by the process and
  176. !   its children that have terminated so far.  Also, the time units used are
  177. !   different (200 Hz ticks instead of microseconds).  When clock() is fixed,
  178. !   CLOCKS_PER_SEC in time.h will need to be changed, as ANSI specifies that
  179. !   clock()/CLOCKS_PER_SEC gives the CPU time used, in seconds, since the
  180. !   beginning of execution.  It may be a good idea to change CLK_TCK to agree,
  181. !   or maybe CLK_TCK should be used for the actual 200 Hz hardware tick, and
  182. !   change only CLOCKS_PER_SEC.  CLK_TCK is used in times.c.  CLOCKS_PER_SEC
  183. !   is used in sleep.c.
  184.   
  185.   getopt.c, unistd.h: ++boender
  186.     The three externally usable variables defined in getopt.c should be
  187.     included in <unistd.h>, where getopt() is declared too.  These
  188.     are: 'extern char *optarg', 'extern int opterr' and 'extern int optind'.
  189. +   [Not really a bug.  Leave it this way because UNIX doesn't have these
  190. +   vars in any headers either. -entropy]
  191.   
  192.   getuid.c: ++boender, ++entropy
  193.     Under UNIX Sys VR3 (didn't check SunOS), setpgrp() takes no parameters
  194.     and sets the process group ID of the calling process to its own process
  195. ***************
  196. *** 113,129 ****
  197.     Could test for (r != x) instead of (r < 0) just to be safe, in setuid() and
  198.     setgid().
  199.   
  200. ! kill.c: ++boender, ++entropy
  201.     On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
  202. !   This is somewhat different under MiNT, where init(1), if run at all,
  203. !   need not have PID 1.  PID 0 is already treated in the correct manner by
  204. !   Pkill().    
  205. ! and 1 definitely deserve special treatment
  206. !   under MiNT in any case, because killing MiNT is a bad idea, and shooting
  207. !   signals at MiNT's child process (be it init(1), or some shell, or whatever)
  208. !   isn't likely to 
  209.   
  210. !   Check behavior against UNIX (SysV).
  211.   
  212.     The man page for the MiNT call Pkill() forgets to mention that
  213.     either the effective user ID of the caller must be zero (super-user) or
  214. --- 94,109 ----
  215.     Could test for (r != x) instead of (r < 0) just to be safe, in setuid() and
  216.     setgid().
  217.   
  218. ! kill.c: ++boender, ++entropy 
  219.     On UNIX (SysV), system processes (PID 0 and 1) are treated specially.
  220. !   This is somewhat different under MiNT, where init(1), if run at all, need
  221. !   not have PID 1.  PID 0 is already treated in the correct manner by
  222. !   Pkill().  PID 1 really deserves special treatment under MiNT in any case,
  223. !   because shooting signals at MiNT's child process (be it init(1), or some
  224. !   shell, or whatever) isn't likely to have the expected results.  I'm not
  225. !   sure if this can reasonably be resolved in the library alone.
  226.   
  227. !   [Check behavior against UNIX (SysV). -entropy]
  228.   
  229.     The man page for the MiNT call Pkill() forgets to mention that
  230.     either the effective user ID of the caller must be zero (super-user) or
  231. ***************
  232. *** 159,181 ****
  233.     - void pause(void)
  234.     - void sigpause(long mask)
  235.   
  236. ! sleep.c: ++boender
  237. !   The TOS version of these routine uses clock(). This may cause
  238. !   trouble is clock() is ever repaired.
  239. !   The MiNT version of these routines repeatedly calls Fselect().
  240. !   This had better be re-implemented using Psigpause(), since
  241. !   on UN*X, any caught signal causes sleep() to be stopped early,
  242. !   with the "unslept" amount of time as return value.
  243. !   Currently, the mintlibs sleep() the full amount of time, then
  244. !   return zero. This is a bug.
  245. !   usleep() is of type void. This may not be correct: it is
  246. !   of type unsigned on UN*X, and should be of type unsigned
  247. !   long in the mintlibs.
  248. !   I'll rewrite these functions if you feel they should be changed.
  249. ! support.h: ++boender
  250. !   Would it be possible to define link(), symlink(), etc. to take
  251. !   `const char *' parameters, or will MiNT need to be changed for that?
  252.   
  253.   system.c: ++boender
  254.     Currently, this function emulates the UN*X function, including
  255. --- 139,149 ----
  256.     - void pause(void)
  257.     - void sigpause(long mask)
  258.   
  259. ! sleep.c: ++boender, ++entropy
  260. !   usleep() is of type void.  This may not be correct:  it is of type
  261. !   unsigned on UN*X, and should be of type unsigned long in the mintlibs.
  262. !   usleep() is not interruptable by signals (is it on UNIX?).  sleep() is
  263. !   only interruptable with 1-second granularity.
  264.   
  265.   system.c: ++boender
  266.     Currently, this function emulates the UN*X function, including
  267. ***************
  268. *** 187,195 ****
  269.     out what a user means by "/bin" on a tos file system, and so on.  The
  270.     current scheme is more likely to work for more users more of the time...
  271.     -entropy]
  272. - times.c: ++entropy
  273. -   Also uses clock().  (See clock.c, sleep.c).
  274.   
  275.   utime.c: ++boender
  276.     stime(): My System V.3 manual state that `The stime() call will
  277. --- 155,160 ----
  278. diff -c ../mntlib27/changes ./changes
  279. *** ../mntlib27/changes    Thu Feb 11 11:54:28 1993
  280. --- ./changes    Fri Feb 19 09:22:34 1993
  281. ***************
  282. *** 4,9 ****
  283. --- 4,62 ----
  284.   Changes are listed in *reverse* order, most recent changes being
  285.   first.
  286.   
  287. + PATCHLEVEL28::
  288. + a64l.c: ++boender@dutiws.twi.tudelft.nl
  289. +     Add to comments a note that prototypes are in support.h.
  290. + alarm.c: ++boender, ++entropy
  291. +     If requested time is greater than MiNT can handle, "round down" to
  292. +     (LONG_MAX/1000) seconds, to prevent unexpected "inquiry" calls to
  293. +     Talarm() (or even possible crashes).  This is only relevant if long
  294. +     integers are used, since (USHRT_MAX < (LONG_MAX/1000)).  Do NOT set
  295. +     errno if an error results (the only error that can be recognized,
  296. +     anyway, is that alarm() was called when MiNT was not active.  In
  297. +     this case, 0 is returned and no alarm is set.)
  298. + getpass.c:
  299. +     Read password from /dev/tty, instead of stdin, if MiNT is active.
  300. + link.c, symlink.c, support.h:
  301. +     Functions link(), symlink() now take "const char *" instead of
  302. +     "char *" parmeters.
  303. + getcwd.c: ++boender, ++entropy
  304. +     Use Dgetcwd() when running on MiNT 0.96 or newer.
  305. + limits.h: ++jrb (bammi@cadence.com)
  306. +     Fix definition of INT_MIN, evidently casting it to float didn't work
  307. +     with the old (equivalent) value.
  308. + stdlib.h: ++jrb
  309. +     Changed alloca macro for better parameter checking.
  310. + eprintf.c: ++jrb
  311. +     Make _say() a function instead of a macro.
  312. + fwrite.c, linea.c: ++jrb
  313. +     Some stuff I missed in patchlevel 26.
  314. + vdiesc1.h: ++jrb
  315. +     DELETED file, seems this was some leftover temp file, everything in
  316. +     it is already in vdibind.h.
  317. + access.c: ++boender, ++entropy
  318. +     Use real, not effective, user id's for access() checks.
  319. +     Fix so access() always returns success on existing files if real
  320. +     user id is 0 (root), regardless of file mode.
  321. + stat.c: ++ers
  322. +     Fix so stat("foo\\") is equivalent to stat("foo"), under TOS.
  323. + unx2dos.c: ++hohmuth
  324. +     Support unx2dos() and dos2unx() on non-GCC compilers (to the minimal
  325. +     extent to which they are supported on GCC).
  326. + sleep.c: ++entropy, ++boender
  327. +     Allow sleep() to be interrupted by signals under MiNT (0.95 or
  328. +     greater) by re-implementing with Psigpause() etc.
  329. + clock.c, getrusag.c, sleep.c, thread.c, times.c, time.h: ++boender, ++entropy
  330. +     Replace all occurrences of clock() with _clock(), temporarily
  331. +     alias clock() to call _clock() until we have something better.
  332. + times.c:
  333. +     Set errno and return -1 on error.
  334. + mintbind.h:
  335. +     Add new GEMDOS functions (macros) Dgetcwd() and Salert().
  336. + errno.h: ++boender
  337. +     Define ENODEV as alias for EUKDEV/EUNDEV.
  338.   PATCHLEVEL27::
  339.   
  340.   isatty.c:
  341. diff -c ../mntlib27/clock.c ./clock.c
  342. *** ../mntlib27/clock.c    Tue Jun 23 17:10:44 1992
  343. --- ./clock.c    Wed Feb 17 14:23:24 1993
  344. ***************
  345. *** 1,4 ****
  346. ! /* clock -- return process time used so far, in units of CLK_TCK ticks
  347.      per second (under TOS, 200 per second) */
  348.   /* written by ERS */
  349.   
  350. --- 1,4 ----
  351. ! /* _clock -- return process time used so far, in units of CLK_TCK ticks
  352.      per second (under TOS, 200 per second) */
  353.   /* written by ERS */
  354.   
  355. ***************
  356. *** 16,23 ****
  357.   static void getnow() { now = *((unsigned long *) 0x4baL); }
  358.   
  359.   clock_t
  360. ! clock()
  361.   {
  362.       (void)Supexec(getnow);
  363.       return (now - _starttime);
  364.   }
  365. --- 16,35 ----
  366.   static void getnow() { now = *((unsigned long *) 0x4baL); }
  367.   
  368.   clock_t
  369. ! _clock()
  370.   {
  371.       (void)Supexec(getnow);
  372.       return (now - _starttime);
  373.   }
  374. + /* This next bit of nonsense is temporary...clock() should be fixed! */
  375. + #ifdef __GNUC__
  376. + asm(".stabs \"_clock\",5,0,0,__clock"); /* dept of clean tricks */
  377. + #else /* ! __GNUC__ */
  378. + clock_t
  379. + clock()
  380. + {
  381. +   return _clock();
  382. + }
  383. + #endif /* ! __GNUC__ */
  384. diff -c ../mntlib27/eprintf.c ./eprintf.c
  385. *** ../mntlib27/eprintf.c    Sat Sep  5 19:20:08 1992
  386. --- ./eprintf.c    Sat Feb 13 07:23:24 1993
  387. ***************
  388. *** 14,22 ****
  389.      Modified to do its own work rather than call fprintf().
  390.   */
  391.   
  392. - #define _say(s) _write(2,s,(long)strlen(s))
  393.   
  394.   static char buf[20];    /* big enough for any value of a long */
  395.   
  396.   /* This is used by the `assert' macro.  */
  397.   void __eprintf (expression, line, filename)
  398. --- 14,27 ----
  399.      Modified to do its own work rather than call fprintf().
  400.   */
  401.   
  402.   
  403.   static char buf[20];    /* big enough for any value of a long */
  404. + static void _say(s)
  405. + char *s;
  406. + {
  407. +     _write(2,s,(long)(strlen(s)));
  408. + }
  409.   
  410.   /* This is used by the `assert' macro.  */
  411.   void __eprintf (expression, line, filename)
  412. diff -c ../mntlib27/fwrite.c ./fwrite.c
  413. *** ../mntlib27/fwrite.c    Thu Jan 21 16:16:00 1993
  414. --- ./fwrite.c    Sat Feb 13 07:23:38 1993
  415. ***************
  416. *** 8,14 ****
  417.   #include <string.h>
  418.   #include "lib.h"
  419.   
  420. ! extern short __FRW_BIN__;
  421.   
  422.   size_t    fwrite(_data, size, count, fp)
  423.   const void *_data;
  424. --- 8,14 ----
  425.   #include <string.h>
  426.   #include "lib.h"
  427.   
  428. ! extern short  __FRW_BIN__;
  429.   
  430.   size_t    fwrite(_data, size, count, fp)
  431.   const void *_data;
  432. ***************
  433. *** 26,32 ****
  434.       int wrote_cr;
  435.       int line_flush;
  436.   
  437. !     if( (f & _IORW) || __FRW_BIN__ )
  438.       {
  439.           fp->_flag |= _IOWRT;
  440.           f = (fp->_flag &= ~(_IOREAD | _IOEOF));
  441. --- 26,32 ----
  442.       int wrote_cr;
  443.       int line_flush;
  444.   
  445. !     if(f & _IORW)
  446.       {
  447.           fp->_flag |= _IOWRT;
  448.           f = (fp->_flag &= ~(_IOREAD | _IOEOF));
  449. ***************
  450. *** 41,47 ****
  451.       n =  count * size;
  452.       assert ( n <= (size_t)LONG_MAX);  /* otherwise impl will not work */
  453.   
  454. !     if( f&_IOBIN ) {
  455.         space = fp->_bsiz - fp->_cnt;
  456.         while(n > 0)
  457.         {
  458. --- 41,47 ----
  459.       n =  count * size;
  460.       assert ( n <= (size_t)LONG_MAX);  /* otherwise impl will not work */
  461.   
  462. !     if( (f&_IOBIN) || __FRW_BIN__ ) {
  463.         space = fp->_bsiz - fp->_cnt;
  464.         while(n > 0)
  465.         {
  466. diff -c ../mntlib27/getcwd.c ./getcwd.c
  467. *** ../mntlib27/getcwd.c    Sat Sep  5 19:57:32 1992
  468. --- ./getcwd.c    Fri Feb 19 06:24:12 1993
  469. ***************
  470. *** 4,9 ****
  471. --- 4,10 ----
  472.   #include <limits.h>
  473.   #include <errno.h>
  474.   #include <osbind.h>
  475. + #include <mintbind.h>
  476.   #include "lib.h"
  477.   
  478.   /*******************************************************************
  479. ***************
  480. *** 29,38 ****
  481.       char *path;
  482.   #endif
  483.       char drv;
  484.   
  485. !     if (!buf)
  486.           if ((buf = (char *) malloc((size_t)size)) == 0)
  487.               return NULL;
  488.   
  489.       drv = Dgetdrv() + 'a';
  490.       _path[0] = drv;
  491. --- 30,43 ----
  492.       char *path;
  493.   #endif
  494.       char drv;
  495. +     int buf_malloced = 0;
  496. +     int r;
  497.   
  498. !     if (!buf) {
  499.           if ((buf = (char *) malloc((size_t)size)) == 0)
  500.               return NULL;
  501. +         buf_malloced = 1;
  502. +     }
  503.   
  504.       drv = Dgetdrv() + 'a';
  505.       _path[0] = drv;
  506. ***************
  507. *** 39,45 ****
  508.       _path[1] = ':';
  509.       _path[2] = '\0';
  510.       path = _path + 2;
  511. !     (void)Dgetpath(path, 0);
  512.   
  513.       if (_rootdir && drv == _rootdir) {
  514.           if (!*path) {
  515. --- 44,59 ----
  516.       _path[1] = ':';
  517.       _path[2] = '\0';
  518.       path = _path + 2;
  519. !     if (__mint >= 96) {
  520. !         if ((r = Dgetcwd(path, 0, size - 2)) != 0) {
  521. !             if (buf_malloced)
  522. !                 free(buf);
  523. !             errno = -r;
  524. !             return NULL;
  525. !         }
  526. !     } else {
  527. !         (void)Dgetpath(path, 0);
  528. !     }
  529.   
  530.       if (_rootdir && drv == _rootdir) {
  531.           if (!*path) {
  532. diff -c ../mntlib27/getpass.c ./getpass.c
  533. *** ../mntlib27/getpass.c    Fri Jan 15 04:26:10 1993
  534. --- ./getpass.c    Wed Feb 17 18:34:56 1993
  535. ***************
  536. *** 4,9 ****
  537. --- 4,11 ----
  538.   #include <string.h>
  539.   #include <limits.h>
  540.   
  541. + extern int __mint;
  542.   char *
  543.   getpass(prompt)
  544.       const char *prompt;
  545. ***************
  546. *** 11,30 ****
  547.       static char buf[PASS_MAX + 1];
  548.           char *ret;
  549.       struct sgttyb oldsb, newsb;
  550.   
  551.       fflush(stdin);
  552. !     gtty(0, &oldsb);
  553.       newsb = oldsb;
  554.       newsb.sg_flags &= ~ECHO;
  555. !     stty(0, &newsb);
  556.       fputs(prompt, stderr);
  557.       fflush(stderr);
  558. !     if ((ret = fgets(buf, PASS_MAX + 1, stdin)) != 0)
  559.       {
  560.         /* zap the newline */
  561.         if (buf[strlen(buf) - 1] == '\n')
  562.           buf[strlen(buf) - 1] = 0;
  563.       }
  564. !     stty(0, &oldsb);
  565.       return ret;
  566.   }
  567. --- 13,43 ----
  568.       static char buf[PASS_MAX + 1];
  569.           char *ret;
  570.       struct sgttyb oldsb, newsb;
  571. +     FILE *tty;
  572. +     int ttyfd = 0;
  573.   
  574.       fflush(stdin);
  575. !     tty = stdin;
  576. !     if (__mint) {
  577. !         if ((tty = fopen("U:\\DEV\\TTY", "r")) == NULL)
  578. !             return NULL;
  579. !     }
  580. !     ttyfd = fileno(tty);
  581. !     fflush(tty);
  582. !     gtty(ttyfd, &oldsb);
  583.       newsb = oldsb;
  584.       newsb.sg_flags &= ~ECHO;
  585. !     stty(ttyfd, &newsb);
  586.       fputs(prompt, stderr);
  587.       fflush(stderr);
  588. !     if ((ret = fgets(buf, PASS_MAX + 1, tty)) != 0)
  589.       {
  590.         /* zap the newline */
  591.         if (buf[strlen(buf) - 1] == '\n')
  592.           buf[strlen(buf) - 1] = 0;
  593.       }
  594. !     stty(ttyfd, &oldsb);
  595. !     if (__mint)
  596. !         (void) fclose(tty);
  597.       return ret;
  598.   }
  599. diff -c ../mntlib27/getrusag.c ./getrusag.c
  600. *** ../mntlib27/getrusag.c    Sat Sep  5 20:06:44 1992
  601. --- ./getrusag.c    Wed Feb 17 14:09:36 1993
  602. ***************
  603. *** 52,58 ****
  604.           }
  605.       } else {
  606.           usage[0] = usage[2] = 0;
  607. !         usage[1] = clock() - _childtime;
  608.           usage[3] = _childtime;
  609.       }
  610.   
  611. --- 52,58 ----
  612.           }
  613.       } else {
  614.           usage[0] = usage[2] = 0;
  615. !         usage[1] = _clock() - _childtime;
  616.           usage[3] = _childtime;
  617.       }
  618.   
  619. diff -c ../mntlib27/linea.c ./linea.c
  620. *** ../mntlib27/linea.c    Thu Oct  1 14:41:22 1992
  621. --- ./linea.c    Sat Feb 13 07:23:50 1993
  622. ***************
  623. *** 94,108 ****
  624.   
  625.   void linea7(BBPB *P)                             
  626.   {                                    
  627.       __asm__ volatile                        
  628.       ("
  629.           movml    d2/a2/a6, sp@-;
  630.            movl    %0,a6;  
  631.           .word   0xA007;
  632. !         movml    sp@+,d2/a2/a6"
  633.       :                           /* outputs */    
  634.       : "r"(P)                      /* inputs  */    
  635. !     : "d0", "d1", "a0", "a1"           /* clobbered regs */
  636.       );                                
  637.   }
  638.   
  639. --- 94,109 ----
  640.   
  641.   void linea7(BBPB *P)                             
  642.   {                                    
  643. +                                         
  644.       __asm__ volatile                        
  645.       ("
  646.           movml    d2/a2/a6, sp@-;
  647.            movl    %0,a6;  
  648.           .word   0xA007;
  649. !         movml    sp@+, d2/a2/a6"
  650.       :                           /* outputs */    
  651.       : "r"(P)                      /* inputs  */    
  652. !     : "d0", "d1", "a0", "a1"          /* clobbered regs */    \
  653.       );                                
  654.   }
  655.   
  656. ***************
  657. *** 160,171 ****
  658.       __asm__ volatile                        
  659.       ("
  660.            movl    %0,a2;  
  661. !         movl    a6,sp@-;
  662. !         .word   0xA00C;
  663. !         movl    sp@+,a6"
  664.       :                           /* outputs */    
  665. !     : "g"(P)                       /* inputs  */    
  666. !     : "d0", "d1", "d2", "a0", "a1", "a2"       /* clobbered regs */    
  667.       );                                
  668.   }
  669.   
  670. --- 161,170 ----
  671.       __asm__ volatile                        
  672.       ("
  673.            movl    %0,a2;  
  674. !         .word   0xA00C" 
  675.       :                           /* outputs */    
  676. !     : "r"(P)                      /* inputs  */    
  677. !     : "d0", "d1", "d2", "a0", "a1", "a2", "a6" /* clobbered regs */    
  678.       );                                
  679.   }
  680.   
  681. ***************
  682. *** 178,189 ****
  683.            movw    %1,d1;  
  684.            movl    %2,a0;  
  685.            movl    %3,a2;  
  686. !         movl    a6,sp@-;
  687. !         .word   0xA00D;
  688. !         movl    sp@+,a6"
  689.       :                           /* outputs */    
  690. !     : "g"((short)x), "g"((short)y), "g"(sd), "g"(ss)  /* inputs  */    
  691. !     : "d0", "d1", "d2", "a0", "a1", "a2"       /* clobbered regs */    
  692.       );                                
  693.   }
  694.   
  695. --- 177,186 ----
  696.            movw    %1,d1;  
  697.            movl    %2,a0;  
  698.            movl    %3,a2;  
  699. !         .word   0xA00D" 
  700.       :                           /* outputs */    
  701. !     : "r"((short)x), "r"((short)y), "r"(sd), "r"(ss)  /* inputs  */    
  702. !     : "d0", "d1", "d2", "a0", "a1", "a2", "a6" /* clobbered regs */    
  703.       );                                
  704.   }
  705.   
  706. diff -c ../mntlib27/link.c ./link.c
  707. *** ../mntlib27/link.c    Sat Sep  5 20:59:16 1992
  708. --- ./link.c    Sat Feb 13 05:57:28 1993
  709. ***************
  710. *** 3,8 ****
  711. --- 3,9 ----
  712.   #include <errno.h>
  713.   #include <mintbind.h>
  714.   #include <param.h>
  715. + #include <support.h>
  716.   #include "lib.h"
  717.   
  718.   extern int __mint;
  719. ***************
  720. *** 13,19 ****
  721.   
  722.   int
  723.   link(_old, _new)
  724. !     char *_old, *_new;
  725.   {
  726.       long r;
  727.       char old[MAXPATHLEN], new[MAXPATHLEN];
  728. --- 14,20 ----
  729.   
  730.   int
  731.   link(_old, _new)
  732. !     const char *_old, *_new;
  733.   {
  734.       long r;
  735.       char old[MAXPATHLEN], new[MAXPATHLEN];
  736. diff -c ../mntlib27/makefile ./makefile
  737. *** ../mntlib27/makefile    Thu Jan 21 15:21:38 1993
  738. --- ./makefile    Sat Feb 13 09:25:56 1993
  739. ***************
  740. *** 50,56 ****
  741.   # This reflects my setup, your mileage may vary.
  742.   
  743.   AR    := ar
  744. ! LIB    := newlib
  745.   
  746.   endif
  747.   
  748. --- 50,56 ----
  749.   # This reflects my setup, your mileage may vary.
  750.   
  751.   AR    := ar
  752. ! LIB    := /src/newlib
  753.   
  754.   endif
  755.   
  756. diff -c ../mntlib27/patchlev.h ./patchlev.h
  757. *** ../mntlib27/patchlev.h    Sun Jan 17 08:54:30 1993
  758. --- ./patchlev.h    Sat Feb 13 03:24:10 1993
  759. ***************
  760. *** 3,6 ****
  761.    *    directory.
  762.    */
  763.   
  764. ! #define PatchLevel "27"
  765. --- 3,6 ----
  766.    *    directory.
  767.    */
  768.   
  769. ! #define PatchLevel "28"
  770. diff -c ../mntlib27/sleep.c ./sleep.c
  771. *** ../mntlib27/sleep.c    Sat Sep  5 21:28:48 1992
  772. --- ./sleep.c    Wed Feb 17 14:10:08 1993
  773. ***************
  774. *** 1,15 ****
  775.   /* sleep -- sleep for a specified number of seconds */
  776.   /* usleep -- sleep for a specified number of microSecond */
  777.   /* written by Eric R. Smith and placed in the public domain */
  778.   
  779.   #include <time.h>
  780.   #include <mintbind.h>
  781.   
  782. ! /* clock() has a rez of CLOCKS_PER_SEC ticks/sec */
  783.   
  784.   #define USEC_PER_TICK (1000000L / ((unsigned long)CLOCKS_PER_SEC))
  785.   #define    USEC_TO_CLOCK_TICKS(us)    ((us) / USEC_PER_TICK )
  786.   
  787.   unsigned int
  788.   sleep(n)
  789.       unsigned int n;
  790. --- 1,30 ----
  791.   /* sleep -- sleep for a specified number of seconds */
  792.   /* usleep -- sleep for a specified number of microSecond */
  793.   /* written by Eric R. Smith and placed in the public domain */
  794. + /* extensively rehacked by entropy for mint >= 0.95, still public domain */
  795.   
  796.   #include <time.h>
  797.   #include <mintbind.h>
  798. + #include <signal.h>
  799.   
  800. ! #ifndef sigmask /* will not be defined if __STRICT_ANSI__ or not __MINT__ */
  801. ! #define sigmask(sig) (1L << (sig))
  802. ! #endif
  803.   
  804. + /* _clock() has a rez of CLOCKS_PER_SEC ticks/sec */
  805.   #define USEC_PER_TICK (1000000L / ((unsigned long)CLOCKS_PER_SEC))
  806.   #define    USEC_TO_CLOCK_TICKS(us)    ((us) / USEC_PER_TICK )
  807.   
  808. + static void alarm_catch __PROTO((int signum));
  809. + static void
  810. + alarm_catch(signum)
  811. +     int signum;
  812. + {
  813. +     return;
  814. + }
  815.   unsigned int
  816.   sleep(n)
  817.       unsigned int n;
  818. ***************
  819. *** 16,32 ****
  820.   {
  821.       unsigned long    stop;
  822.       extern int __mint;
  823.   
  824.       if (__mint) {
  825. !         while (n > 32) {
  826. !             (void)Fselect(32000, 0L, 0L, 0L);
  827. !             n -= 32;
  828.           }
  829. !         (void)Fselect(1000*n, 0L, 0L, 0L);
  830.       }
  831.       else {
  832. !         stop = clock() + n * CLOCKS_PER_SEC;
  833. !         while (clock() < stop)
  834.               ;
  835.       }
  836.       return 0;
  837. --- 31,87 ----
  838.   {
  839.       unsigned long    stop;
  840.       extern int __mint;
  841. +     __Sigfunc old_alarm_func;
  842. +     long old_sigmask;
  843. +     long alarm_sec;
  844. +     long unslept = 0L;
  845. +     long remain;
  846.   
  847.       if (__mint) {
  848. !         if (__mint < 95) {
  849. !             while (n > 32) {
  850. !                 (void)Fselect(32000, 0L, 0L, 0L);
  851. !                 n -= 32;
  852. !             }
  853. !             (void)Fselect(1000*n, 0L, 0L, 0L);
  854. !             return 0;
  855. !         }
  856. !         if (n == 0)
  857. !             return 0;
  858. !         alarm_sec = Talarm(0L);
  859. !         if (alarm_sec && (alarm_sec < n)) {
  860. !             unslept = n - alarm_sec;
  861. !             n = alarm_sec;
  862. !         }
  863. !         stop = _clock() + n * CLOCKS_PER_SEC;
  864. !         old_sigmask = Psigblock(~0L);
  865. !         old_alarm_func = (__Sigfunc) Psignal(SIGALRM, alarm_catch);
  866. !         (void) Psigblock(~0L);
  867. !         while ((_clock() < stop) && !(Psigpending() 
  868. !                          & ~old_sigmask 
  869. !                          & ~sigmask(SIGALRM))) {
  870. !             Talarm(1L);
  871. !             Psigpause(~sigmask(SIGALRM));
  872. !         }
  873. !         remain = ((long) stop - (long) _clock()) 
  874. !               / (long) CLOCKS_PER_SEC;
  875. !         (void) Talarm(0L);
  876. !         (void) Psignal(SIGALRM, old_alarm_func);        
  877. !         (void) Psigblock(~0L);
  878. !         if (alarm_sec > 0) {
  879. !             alarm_sec -= (n - remain);
  880. !             if (alarm_sec <= 0)
  881. !                 (void) Pkill(Pgetpid(), SIGALRM);
  882. !             else
  883. !                 (void) Talarm(alarm_sec);
  884.           }
  885. !         (void) Psigsetmask(old_sigmask);
  886. !         unslept += remain;
  887. !         return ((unslept > 0) ? (unsigned) unslept : 0);
  888.       }
  889.       else {
  890. !         stop = _clock() + n * CLOCKS_PER_SEC;
  891. !         while (_clock() < stop)
  892.               ;
  893.       }
  894.       return 0;
  895. ***************
  896. *** 48,55 ****
  897.           (void)Fselect((unsigned)(usec/1000), 0L, 0L, 0L);
  898.       }
  899.       else {
  900. !         stop = clock() + USEC_TO_CLOCK_TICKS(usec);
  901. !         while (clock() < stop)
  902.               ;
  903.       }
  904.   }
  905. --- 103,110 ----
  906.           (void)Fselect((unsigned)(usec/1000), 0L, 0L, 0L);
  907.       }
  908.       else {
  909. !         stop = _clock() + USEC_TO_CLOCK_TICKS(usec);
  910. !         while (_clock() < stop)
  911.               ;
  912.       }
  913.   }
  914. diff -c ../mntlib27/stat.c ./stat.c
  915. *** ../mntlib27/stat.c    Sat Sep  5 21:00:48 1992
  916. --- ./stat.c    Wed Feb 17 06:32:56 1993
  917. ***************
  918. *** 133,138 ****
  919. --- 133,140 ----
  920.    * so we kludge around this by using the fact that Fsfirst(".\*.*"
  921.    * or "..\*.*" will return the correct file first (except, of course,
  922.    * in root directories :-( ).
  923. +  * NOTE2: Some versions of TOS don't like Fsfirst("RCS\\", -1) either,
  924. +  * so we do the same thing if the path ends in '\\'.
  925.    */
  926.   
  927.   /* find the end of the string */
  928. ***************
  929. *** 142,147 ****
  930. --- 144,152 ----
  931.       if (*ext == '.' && (ext == path || ext[-1] == '\\' || ext[-1] == '.')) {
  932.           isdot = 1;
  933.           strcat(path, "\\*.*");
  934. +     } else if (*ext == '\\') {
  935. +         isdot = 1;
  936. +         strcat(path, "*.*");
  937.       }
  938.       olddta = Fgetdta();
  939.       Fsetdta(&d);
  940. diff -c ../mntlib27/symlink.c ./symlink.c
  941. *** ../mntlib27/symlink.c    Sat Sep  5 21:01:12 1992
  942. --- ./symlink.c    Sat Feb 13 05:58:42 1993
  943. ***************
  944. *** 16,22 ****
  945.   
  946.   int
  947.   symlink(old, new)
  948. !     char *old, *new;
  949.   {
  950.       char linkname[PATH_MAX];
  951.       char path[PATH_MAX];
  952. --- 16,22 ----
  953.   
  954.   int
  955.   symlink(old, new)
  956. !     const char *old, *new;
  957.   {
  958.       char linkname[PATH_MAX];
  959.       char path[PATH_MAX];
  960. diff -c ../mntlib27/thread.c ./thread.c
  961. *** ../mntlib27/thread.c    Sat Sep  5 21:01:20 1992
  962. --- ./thread.c    Wed Feb 17 14:10:52 1993
  963. ***************
  964. *** 91,97 ****
  965.           savbase = _base;
  966.           _base = b;
  967.   
  968. !         now = clock();
  969.           pid = Pexec(4, 0L, b, 0L);
  970.           (void)Mfree(b->p_env);    /* free the memory */
  971.           (void)Mfree(b);
  972. --- 91,97 ----
  973.           savbase = _base;
  974.           _base = b;
  975.   
  976. !         now = _clock();
  977.           pid = Pexec(4, 0L, b, 0L);
  978.           (void)Mfree(b->p_env);    /* free the memory */
  979.           (void)Mfree(b);
  980. ***************
  981. *** 109,115 ****
  982.               pid = ((long)b) >> 8;
  983.               __waitval = (pid << 16) | retval;
  984.               raise(SIGCHLD);
  985. !             __waittime = clock() - now;
  986.               _childtime += __waittime;
  987.           }
  988.       }
  989. --- 109,115 ----
  990.               pid = ((long)b) >> 8;
  991.               __waitval = (pid << 16) | retval;
  992.               raise(SIGCHLD);
  993. !             __waittime = _clock() - now;
  994.               _childtime += __waittime;
  995.           }
  996.       }
  997. diff -c ../mntlib27/times.c ./times.c
  998. *** ../mntlib27/times.c    Wed Feb 10 06:56:00 1993
  999. --- ./times.c    Wed Feb 17 15:21:26 1993
  1000. ***************
  1001. *** 5,10 ****
  1002. --- 5,11 ----
  1003.   #endif
  1004.   #include <time.h>
  1005.   #include <mintbind.h>
  1006. + #include <errno.h>
  1007.   
  1008.   extern int __mint;
  1009.   extern long _childtime;
  1010. ***************
  1011. *** 18,24 ****
  1012.   {
  1013.       long usage[8], r, real_time;
  1014.   
  1015. !     real_time = clock();
  1016.   
  1017.       if (__mint) {
  1018.           r = Prusage(usage);
  1019. --- 19,25 ----
  1020.   {
  1021.       long usage[8], r, real_time;
  1022.   
  1023. !     real_time = _clock();
  1024.   
  1025.       if (__mint) {
  1026.           r = Prusage(usage);
  1027. ***************
  1028. *** 29,34 ****
  1029. --- 30,39 ----
  1030.               buffer->tms_stime = CVRT(usage[0]);
  1031.               return real_time;
  1032.           }
  1033. +         if (!buffer)
  1034. +             errno = EFAULT;
  1035. +         errno = -r;
  1036. +         return -1;
  1037.       }
  1038.   
  1039.       if (buffer) {
  1040. diff -c ../mntlib27/unx2dos.c ./unx2dos.c
  1041. *** ../mntlib27/unx2dos.c    Mon Jun  8 05:22:24 1992
  1042. --- ./unx2dos.c    Wed Feb 17 06:36:28 1993
  1043. ***************
  1044. *** 3,8 ****
  1045. --- 3,9 ----
  1046.   #include <ctype.h>
  1047.   #include <osbind.h>
  1048.   #include <types.h>
  1049. + #include <support.h>
  1050.   
  1051.   extern int __mint;
  1052.   extern char _rootdir;    /* in main.c: user's preferred root directory */
  1053. ***************
  1054. *** 98,103 ****
  1055. --- 99,124 ----
  1056.   }
  1057.   
  1058.   #ifdef __GNUC__
  1059.   asm(".stabs \"_unx2dos\",5,0,0,__unx2dos"); /* dept of clean tricks */
  1060.   asm(".stabs \"_dos2unx\",5,0,0,__dos2unx"); /* dept of clean tricks */
  1061. + #else /* ! __GNUC__ */
  1062. + int
  1063. + unx2dos(unx, dos)
  1064. +         const char *unx;
  1065. +         char *dos;
  1066. + {
  1067. +     return _unx2dos(unx, dos);
  1068. + }
  1069. + int
  1070. + dos2unx(dos, unx)
  1071. +         const char *dos;
  1072. +         char *unx;
  1073. + {
  1074. +     return _dos2unx(dos, unx);
  1075. + }
  1076.   #endif
  1077.